package com.heying.springcore.xml;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestSpring {


    public static void main(String[] args) {

        //加载classpath下的配置文件，加载ioc容器。创建好beanfactory
        ClassPathXmlApplicationContext context =
                new ClassPathXmlApplicationContext("applicationContext.xml");
        //单列实现的。aaa和aaa2地址是一样的
        AAA aaa = context.getBean("aaa",AAA.class);
        AAA aaa2 = context.getBean("aaa",AAA.class);
        System.out.println(aaa);
        System.out.println(aaa == aaa2);

    }
}
